package lt.ntec.danblog.server.core.validator.rules;

import lt.ntec.danblog.server.core.Message;
import lt.ntec.danblog.server.core.Messageable;
import lt.ntec.danblog.server.core.validator.Rule;

public class EmailRule extends PatternRule implements Rule {

    @Override
    protected String getPattern() {
        return "^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Za-z]{2,4}$";
    }

    @Override
    public Messageable getMessage() {
        return new Message(Messageable.Type.NOTICE, "Email is not valid");
    }
}
